
export const columns = [
    {
        type: 'radio', //radio
        fixed: "left",
        minWidth: 55,
        title: "",
        width: 55,
        align: "center",
        
    },
    {
        type: "seq",
        title: "序号",
        visible: true,
        minWidth: 70,
        width: 70,
        align: "center",
    },
    // {
    //     field: "custId",
    //     title: "客户id",
    //     visible: true,
    //     minWidth: 120,
    //     align: "center",
    // },
    {
        field: "custName",
        title: "客户名称",
        visible: true,
        minWidth: 120,
        align: "center",
    },
    {
        field: "shortName",
        title: "简称",
        visible: true,
        minWidth: 120,
        align: "center",
        formatter: ({ cellValue }) => {
            return cellValue ? cellValue : "暂无";
        },
    },

    {
        field: "idTyyx",
        title: "统一信用编码",
        visible: true,
        minWidth: 120,
        align: "center",
       
    },
]

export const flutter = [
    {
        type: 'INPUT',
        operator: '=like=',
        // title: '客户名称',
        show: true,
        value: undefined,
        key: 'custName',
        placeholder: '请输入',
    },
  
]

export const batchGroup = [
    {
        name: '删除',
        url: '/task/deleteTask',
        key: 'taskId',
        params: {},
    },
    {
        name: '导出',
        url: 'maintenance/hosts/del',
        key: 'ids',
        params: {},
    },
]

export const setTreeData = res => {
    const computeData = menuArr => {
        menuArr.forEach(element => {
            if (element.leaf !== undefined || element.leaf !== null) {
                element.leaf = !element.leaf
            }
            if (element.children && element.children.length) {
                computeData(element.children)
            }
        })
    }
    if (res.data.length) {
        computeData(res.data)
    }
    res.data = XEUtils.toTreeArray(res.data)
    res.data.forEach(element => {
        delete element['children']
    })
    return res
}


